import React, {useEffect, useState} from 'react';
import {ScrollView, View, Text, TouchableOpacity} from 'react-native';
import {useNavigation} from '@react-navigation/native';
import AreaView from '../../components/Layout/AreaView';
import Banner from '../../components/Banner';
import styles from './style';
import {getEnrollDetail} from '../../service/my';

const ApplyList = (props) => {
  const {
    route: {
      params: {erId},
    },
  } = props;

  const navigation = useNavigation();
  const [detail, setDetail] = useState({});
  useEffect(() => {
    navigation.setOptions({
      title: '报名详情',
    });
    getEnrollDetail(erId).then((res) => {
      console.log(res);
      setDetail(res.data);
    });
  }, [navigation]);
  return (
    <AreaView>
      {/* <View style={styles.wrapper_container}>
        <Banner />
      </View> */}
      <ScrollView style={styles.container}>
        <TouchableOpacity  activeOpacity={1} activeOpacity={1} style={styles.list}>
          <Text style={styles.title}>{detail.erTitle}</Text>
          <Text style={styles.desc}>
            活动时间：{detail.beginTime} ～ {detail.endTime}
          </Text>
          <Text style={styles.desc}>活动费用：{detail.fee || '免费'}</Text>
          <Text style={styles.desc}>
            {detail?.content?.replace(/<\/?.+?\/?>/g, '')}
          </Text>
          <Text style={styles.desc}>报名内容</Text>
          <Text style={styles.desc}>姓名：{detail.name}</Text>
          <Text style={styles.desc}>联系电话：{detail.phone}</Text>
          <Text style={styles.desc}>性别：{detail.sex}</Text>
          <Text style={styles.desc}>人数：{detail.num}</Text>
        </TouchableOpacity>
      </ScrollView>
    </AreaView>
  );
};

export default ApplyList;
